import React, { useState, useEffect } from 'react'
import { Link } from 'react-router-dom';
import food1 from '../../../static/img/food/food1.gif';
import './index.css'
import { useNavigate } from 'react-router-dom';
import axios from 'axios';
import Roll from '../../../components/Roll';
import Nav from '../../../components/Nav';
import { aUrl } from '../../../static/axios_url';
export default function Jfstore() {
    let navigate = useNavigate();
    const [jfData, setjfData] = useState([])
    useEffect(() => {
        axios.post(aUrl + '/jfstoreData', { ye: 1 }).then((res) => {
            setjfData(res.data)
        })
    }, [])

    return (
        <div>
            <Nav num={4} />
            <div className="lunbo">
                <Roll />
            </div>
            <ul className='jfLi-main'>
                {jfData.map((jfData, i) => {
                    return <li key={i} >
                        <img src={jfData.img} alt="" />
                        <h3><Link to={'/jfparticulars?' + jfData.id}>{jfData.title}</Link></h3>
                        <h4>{jfData.tip}</h4>
                        <h5>积分 ：<span>{jfData.jf}</span>价值 ：￥{jfData.new_price}</h5>
                        <h6><Link to={'/jfshop?' + jfData.id}>立刻兑换</Link></h6>
                    </li>
                })}
            </ul>
        </div>
    )
}
